#ifndef DEADLINETIMERPOOL_H
#define DEADLINETIMERPOOL_H

#include "core_global.h"
#include <boost/noncopyable.hpp>
#include <boost/asio/deadline_timer.hpp>
#include <boost/pool/object_pool.hpp>

class DeadlineTimerPool :
        protected boost::noncopyable
{
public:
    typedef boost::asio::io_service Service;
    typedef boost::asio::deadline_timer Timer;
    typedef boost::shared_ptr< Timer > TimerPtr;
    typedef boost::object_pool< Timer > TimerPool;

public:
    DeadlineTimerPool();
    ~DeadlineTimerPool();

    TimerPtr alloc(Service &service);

protected:
    void destroy(Timer *p);

private:
    TimerPool m_pool;
};

#endif // DEADLINETIMERPOOL_H
